package com.mk.web;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * Created by WangChen on 2018/11/25 14:40.
 */
public class Test {

    public static void main(String [] args){
        Map map = new HashMap();
        map.put(null, null);
        map.put("", "a");
        map.put(null, "s");
        System.out.println(map);

        List list = new ArrayList();
//        list.add(1);
//        list.add(1);
        list.add("s");
//        list.add(new HashMap());

        String s = "a";
        String s1 = s;
        System.out.println(s1.equals(s));
        list.add(s);
        list.add(s1);
        System.out.println(list);
        m1();
    }

    static void m1(){
        List<Integer> list = new ArrayList<>();
        list.add(10);
        list.add(20);
        list.add(50);
        list.add(12);
        list.add(2);
        System.out.println(list);
        Collections.sort(list);
        System.out.println(list);

        int result = Collections.binarySearch(list, 12);
        System.out.println("result:" + result);
    }
}